<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"  xmlns:ui="http://java.sun.com/jsf/facelets"                        
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"      >
    <h:head>     
        <link href="#{facesContext.externalContext.requestContextPath}/resources/css/default.css" rel="stylesheet" type="text/css" />
        <link href="#{facesContext.externalContext.requestContextPath}/resources/css/cssLayout.css" rel="stylesheet" type="text/css" />
        <link href="#{facesContext.externalContext.requestContextPath}/resources/css/menu.css" rel="stylesheet" type="text/css" />
        <title>Blue Pumpkin Admin Page</title>
    </h:head>
    <h:body>
        <div class="main_body_admin" >
            <div class="separator_div"/>
            <div class="admin_logo"/>

            <h:form id="frmMain">
                <p:menubar style="text-align: center" >
                     <p:menuitem value="Event" actionListener="#{naviagtionControl.redirectToEventPage()}" > </p:menuitem> 
                    <p:menuitem value="Prize" actionListener="#{naviagtionControl.redirectToPrizePage()}" ></p:menuitem> 
                    <p:menuitem value="User"  style="color: blueviolet; font-weight: bold" styleClass="admin_menu_current" ></p:menuitem> 
                    <p:menuitem value="FAQ"  actionListener="#{naviagtionControl.redirectToFAQsPage()}" ></p:menuitem> 
                    <p:menuitem value="Contact" actionListener="#{naviagtionControl.redirectToContactPage()}"  ></p:menuitem> 
                    <p:menuitem value="Registration" actionListener="#{naviagtionControl.redirectToRegistrationPage()}" ></p:menuitem> 
                    <p:menuitem value="Winner" actionListener="#{naviagtionControl.redirectToWinnerPage()}"  ></p:menuitem> 
                    <p:menuitem value="Comment" actionListener="#{naviagtionControl.redirectToCommentsPage()}"  ></p:menuitem> 
                    <p:submenu label="#{userControl.user.fullName}"    >
                         <p:menuitem value="Edit Profile" actionListener="#{userControl.redirectToLogonUserPage()}" ></p:menuitem> 
                        <p:menuitem value="Log out" actionListener="#{userControl.logout()}"  ></p:menuitem> 
                    </p:submenu>


                </p:menubar>
            </h:form>

            <div class="content_display">
                <h:form>
                    <p:toolbar>
                        <p:toolbarGroup>
                            <p:commandButton value="Add User" actionListener="#{userControl.redirectToAddUserPage()}"/>
                            <p:commandButton value="View Users" actionListener="#{userControl.redirectToListUserPage()}" />
                            <p:commandButton value="Edit User" actionListener="#{userControl.redirectToEditUserPage()}" />

                        </p:toolbarGroup>
                    </p:toolbar>
                </h:form>
                <p:spacer height="5px" />



                <h:form enctype="multipart/form-data">
                    <p:panel id="panel" header="User Details" style="width: 99%">



                        <h:panelGrid columns="2" style="width: 80%">
                            <h:outputText value="Avatar" />
                            <h:commandLink id="preview" value="" ><img src="#{userControl.selectedtuser.avatar}" height="100" width="70" /></h:commandLink>

                            <h:outputLabel value="UserName:" for="userName" />
                            <h:outputText value="#{userControl.selectedtuser.username}"/>   
                            <h:outputLabel value="Sex:" for="sex" />
                            <h:outputText value="#{userControl.selectedtuser.genger}"/>
                            <h:outputLabel value="FullName:" for="fullName" />
                            <h:outputText value="#{userControl.selectedtuser.fullName}"/>
                            <h:outputLabel value="Birthday:" for="birthday" />  
                            <h:outputText value="#{userControl.selectedtuser.dob}">
                                <f:convertDateTime pattern="MM/dd/yyyy" />
                            </h:outputText>                 
                            <h:outputLabel value="Phone" for="phone"/>
                            <h:outputText value="#{userControl.selectedtuser.phone}"/>                                        
                            <h:outputLabel value="Address:" for="address" />
                            <h:outputText value="#{userControl.selectedtuser.address}"/>
                            <h:outputLabel value="Email:" for="email" />
                            <h:outputText value="#{userControl.selectedtuser.email}"/>
                            <h:outputLabel value="JoinedDate:" for="joinedDate" />
                            <h:outputText value="#{userControl.selectedtuser.joinedDate}">
                                <f:convertDateTime pattern="MM/dd/yyyy" />
                            </h:outputText>
                            <h:outputLabel value="IsAdmin:" for="isAdmin" />
                            <h:outputText value="#{userControl.selectedtuser.isAdmin}"/>
                            <h:outputLabel value="IsActive:" for="isActive" />
                            <h:outputText value="#{userControl.selectedtuser.active}"/>
                            <h:outputLabel value="DepartmentName:" for="departmentName" />
                            <h:outputText value="#{userControl.selectedtuser.department}"/>  
                        </h:panelGrid>
                    </p:panel> 


                </h:form>



            </div>
        </div>
    </h:body>
</html>
